#include <iostream>
#include <string>
using namespace std;

bool cmp(string s1, string s2){
    if(s1.size() != s2.size()) return false;
    else{
        for(int i=1; i<=s1.size()-1; ++i){
            if(s1[i] == s2[i]) continue;
            else return false;
        }
        return true;
    }
}
int main() {
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    s.insert(0, 1, '0');
    int M;
    cin >> M;

    int a, b, c, d;
    for(int i=1; i<=M;++i){
        cin >> a >> b >> c >>d;
        string s1 = s.substr(a, (b-a+1)), s2 = s.substr(c, (d-c+1));
        if(cmp(s1, s2)) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}
/*
aabbaabb
3
1 3 5 7
1 3 6 8
1 2 1 2

 */